/**
 * 
 */
$(document).ready(function() 
{
	var i=1;
	for (var key in localStorage)
	{
		if (key!="gameNumber")
		{	
		$('#games').append("<tr class='gameTableRow' id='tr"+String(key)+"'><td class='gameTableCell' id='td"+
		String(key)+"'> Mang nr: "+String(key)+"<td><tr>");
		i+=1;
		}
	}
	$('.gameTableRow').live('click' ,function()		
	{	
		var LinkToGame = "./replayPage.html?id="+($(this).attr('id').split("tr")[1])
		parent.$.fancybox.open({href:LinkToGame,
			type:'iframe',
			autoSize:false,
			width : '100%',
			height: '100%',
			fitToView : false});
		//alert("test!");
		//window.location.replace("./replayPage.html?id="+($(this).attr('id').split("tr")[1]));
		
		
	}
	);
});